<script src="../../routers/main.js"></script>
<script src="../../models/blog.js"></script>
<script src="../../routers/admin.js"></script>
<script src="../../routers/api.js"></script>{% extends 'layout.html'%}
{% block title%}添加博客{%endblock%}
{% block body%}
{% block scripts%}
<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js">
</script>
<script>
    $(function(){
        let $submit = $('#submit');
        let $name =$('#name')
        $("#submit").click(function(){
            $.post("/admin/category/add",{
                    name:$name.val(),
                    articleNumber:0,
                },
                function(result){
                    alert(result.msg);
                    window.location.href='/admin/category?page=1';
                });
        });
    });
</script>
{%endblock%}
<form>
    <div class="form-group" >
        <h4>新建分类</small></h4>
        <h5>分类名称</h5>
        <input id="name" type="text" class="form-control" placeholder="名称"  >
    </div>
</form>

<button id="submit" type="button" class="btn btn-primary btn-lg btn-block">提交</button>
{% endblock%}